package com.huihui.vueadminapi.entity;

import java.util.ArrayList;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;

/**
 * 用户表(SysUser)表实体类
 *
 * @author liyonghui
 * @since 2022-04-14 14:09:17
 */
@EqualsAndHashCode(callSuper = true)
@Data
@ApiModel(description = "")
@SuppressWarnings("serial")
public class SysUser extends Model<SysUser> implements Serializable {
    private static final long serialVersionUID = -73832255149920096L;

    @ApiModelProperty("用户ID")
    @TableId(value="id",type= IdType.AUTO)
    private Long id;

    @NotBlank(message = "用户名不能为空")
    @ApiModelProperty("用户名")
    private String username;

    @ApiModelProperty("密码")
    private String password;

    @ApiModelProperty("头像")
    private String avatar;

    @ApiModelProperty("邮箱")
    @NotBlank(message = "邮箱不能为空")
    @Email(message = "邮箱格式不正确")
    private String email;

    @ApiModelProperty("城市")
    private String city;

    @ApiModelProperty("创建时间")
    private Date created;

    @ApiModelProperty("更新时间")
    private Date updated;

    @ApiModelProperty("最后登录时间")
    private Date lastLogin;

    @ApiModelProperty("状态")
    private Integer statu;

    @TableField(exist = false)
    private List<SysRole> sysRoles = new ArrayList<>();
}

